package com.zareal.ymcc.controller;

import com.zareal.ymcc.dto.CourseSearchDto;
import com.zareal.ymcc.result.JSONResult;
import com.zareal.ymcc.result.PageList;
import com.zareal.ymcc.service.ICourseSearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/course")
public class CourseSearchController {
    @Autowired
    private ICourseSearchService courseSearchService;
    @PostMapping("/search")
    public JSONResult search(@RequestBody CourseSearchDto courseSearchDto){
        PageList<CourseSearchDto> list = courseSearchService.search(courseSearchDto);
        return JSONResult.success(list);
    }
}
